<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>清空数组</title>
</head>
<body>
<script>
    /*
      使用splice方法:
        let ary = [1,2,3,4]
        ary.splice(0,ary.length)
        console.log(ary)
    */

   /*
   将数组的长度赋值为0:
       let ary = [1,2,3,4]
        ary.length = 0
        console.log(ary)
    */

    /*
    将数组赋值为空数组:
        let ary = [1,2,3,4]
        ary = []
        console.log('ary',ary)
    */




</script>
</body>
</html>
